<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本数据操作</title>
</head>
<body>
    <div id="app">
        <!-- v-text属性不可以放到容器上 -->
        <h2 v-text="name"></h2>
        <!-- html结构用{{}}包裹只会原样输出，要放在v-html中才会编译 -->
        <div v-html="html"></div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.29/vue.global.prod.min.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    name:"后盾人",
                    html: "<p style='color:green;'>hdms</p>"
                }
            },
        });
        const vm = app.mount('#app');

        console.log(vm.$data.name);     //相当于console.log(vm.name);

        setTimeout(() => {
            // 绑定的数据可以改变
            vm.$data.name = "houdunren"
        },3000);
    </script>
</body>
</html>